home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / quicktime / goodies / qtgraphimp / qtgraphimp.h < prev    next >
Encoding:
Text File  |  2000-06-23  |  1.6 KB  |  72 lines

  1. //////////
  2. //
  3. //    File:        QTGraphImp.h
  4. //
  5. //    Contains:    Sample code for using QuickTime's graphic import routines.
  6. //                This file is used for BOTH MacOS and Windows.
  7. //
  8. //    Written by:    Tim Monroe
  9. //                Based loosely on the SimpleGIExample.c code written by Apple DTS.
  10. //
  11. //    Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  12. //
  13. //    Change History (most recent first):
  14. //
  15. //       <1>         04/14/98    rtm        first file
  16. //       
  17. //////////
  18.  
  19. //////////
  20. //
  21. // header files
  22. //
  23. //////////
  24.  
  25. #include <ImageCompression.h>
  26. #include <Movies.h>
  27. #include <OSUtils.h>
  28. #include <QuickTimeComponents.h>
  29. #include <Script.h>
  30. #include <StandardFile.h>
  31.  
  32. //////////
  33. //
  34. // compiler flags
  35. //
  36. //////////
  37.  
  38. // do we use a data-flushing procedure?
  39. #define USE_FLUSH_PROC                1
  40.  
  41. //////////
  42. //
  43. // constants
  44. //
  45. //////////
  46.  
  47. #if USE_FLUSH_PROC
  48. #define kBufferSize                    codecMinimumDataSize
  49. #else
  50. #define kBufferSize                    (500 * 1024)
  51. #endif
  52.  
  53. #define kImageFileCreator            FOUR_CHAR_CODE('ogle')
  54.  
  55. #define kSaveImagePrompt            "Save compressed image as:"
  56. #define kSaveImageFileName            "Untitled.jpg"
  57.  
  58.  
  59. //////////
  60. //
  61. // function prototypes
  62. //
  63. //////////
  64.  
  65. void                            QTGraphImp_PromptUserForImageFileAndDisplay (void);
  66. void                            QTGraphImp_PromptUserForDiskFileAndSaveCompressed (void);
  67. void                            QTGraphImp_SaveCompressedImage (GWorldPtr theWorld, FSSpec *theFile);
  68. PASCAL_RTN OSErr                QTGraphImp_DataUnloadProc (Ptr theData, long theBytesNeeded, long theRefCon);
  69. OSErr                            QTGraphImp_ExportGWorldToFile (GWorldPtr theWorld, FSSpec *theFile, OSType theType);
  70. OSErr                            QTGraphImp_GetAvailableExportTypes (GraphicsImportComponent theImporter);
  71. OSErr                            QTGraphImp_ExportImageFile (GraphicsImportComponent theImporter);
  72.